package com.tanhua.server.service;

import com.tanhua.commons.utils.UserHolder;
import com.tanhua.dubbo.api.UserApi;
import com.tanhua.model.domain.User;
import com.tanhua.model.vo.HuanXinUserVo;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service
public class HuanxinService {

    @DubboReference
    private UserApi userApi;
    public HuanXinUserVo findByHuanxinUser() {
        Long userId = UserHolder.getUserId();
        User user = userApi.findById(userId);
        return new HuanXinUserVo(user.getHxUser(),user.getPassword());
    }
}
